UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HQusXgk5zKX6NNuOfLKAX3Rm0JOvefuYcWhcxsHLQT8='
WHERE
key_id = 'd584a02d9fe10811487645bf872435cebc7903c2b11791cabe9fa23d03155ae7'
AND (
token = 'HQusXgk5zKX6NNuOfLKAX3Rm0JOvefuYcWhcxsHLQT8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)