UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'YGLXTxPqf4yp6YI7hbxu8H4l0dS1CQdWSHq/EyZO6fs='
WHERE
key_id = '2aead6cdd8ca14af243be73fee7f63f9d36caa984d576d7ba7ffc89d1c642ee3'
AND (
token = 'YGLXTxPqf4yp6YI7hbxu8H4l0dS1CQdWSHq/EyZO6fs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)