UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jup59UIEX90yRFrZlKzUhskW24WUGWBeMtavKrLcvk0='
WHERE
key_id = '083d5215e54bae93ed95cb594696e3565e68ee0eee070fc80b9b522eb4a802ab'
AND (
token = 'jup59UIEX90yRFrZlKzUhskW24WUGWBeMtavKrLcvk0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)