UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'mbRJ4XQexAeODVxtDiejRZnIwY6PHF01IjpwKxtyoc0='
WHERE
key_id = '2cdbd2a7ee4ff7327adc78d599ee670c5d034f2d24820a55dae35d06be1d677c'
AND (
token = 'mbRJ4XQexAeODVxtDiejRZnIwY6PHF01IjpwKxtyoc0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)