UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '5i7Zte4ZFmF0arrd2ESjeyj7681kr0Yi4otDqciVUSs='
WHERE
key_id = 'df344c6fd09cc3255e98dbe600b528a9b1110e30a6e7b1c574000a71e819bd2e'
AND (
token = '5i7Zte4ZFmF0arrd2ESjeyj7681kr0Yi4otDqciVUSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)