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