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