UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'puAdevszg3cVIJ7/iZiALZW3okSi44vWbyoAy7xCIUI='
WHERE
key_id = '4da4fabe6c2228072cf4c6c9553118435463f4f94a0b40d86a05e69ea7707edb'
AND (
token = 'puAdevszg3cVIJ7/iZiALZW3okSi44vWbyoAy7xCIUI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)