UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K8UQMpMRrJT3XOhcPvKCgAVRZ0cjhzUlvf4Px7TbsAY='
WHERE
key_id = '6185abfe267de597e0f9ee3958273e0628a45742e2f8080ab7017236c9b82aa9'
AND (
token = 'K8UQMpMRrJT3XOhcPvKCgAVRZ0cjhzUlvf4Px7TbsAY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)