UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Wawhg6HBqWR2PfNQRmzr5svPkMyybV3xBmDel+elCok='
WHERE
key_id = 'd0a190dc5cb2582fcc3d73c7919e6a72ba3f858ad753cf1e3b2d7e0a7a83246e'
AND (
token = 'Wawhg6HBqWR2PfNQRmzr5svPkMyybV3xBmDel+elCok='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)