UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jyqYwABGdstsOQrv9KxUbcL1NndpWIs0EtkBB2GNzd4='
WHERE
key_id = '4006b521a26fa1fa19acee41fc8ab5f4a2233e1eb9c5316cbc172bd92b6d113e'
AND (
token = 'jyqYwABGdstsOQrv9KxUbcL1NndpWIs0EtkBB2GNzd4='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)