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