UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'uOF3jgXYgp4Bdd1fmc8FxHLivcb287a9IHTLvwVy858='
WHERE
key_id = '3c83842cb70b04b3558b521ad00edba975c3fdcfddc2361c63222f5499d0486f'
AND (
token = 'uOF3jgXYgp4Bdd1fmc8FxHLivcb287a9IHTLvwVy858='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)