UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/Rk8AVFMbEKmfhqdU6UxQLC9Tqr9C1Kkf6Lf6ZmiwEQ='
WHERE
key_id = 'e7892d5ab1d4671fce25a8991c03e240246aa02f2fe0d04ee1a5f5f50696fc5c'
AND (
token = '/Rk8AVFMbEKmfhqdU6UxQLC9Tqr9C1Kkf6Lf6ZmiwEQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)