UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'AIL3M9mvC7A7+goHjUtQ1fmysC1CUKu3Xl63FCby+Vw='
WHERE
key_id = 'f14334550d47edfadf4522ee27d41eb0a7fdf9bb7671b1d2fb1f28c76aad36de'
AND (
token = 'AIL3M9mvC7A7+goHjUtQ1fmysC1CUKu3Xl63FCby+Vw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)