UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Pb84OacbXPbScO3Xm80BvlXmq36o/JqH7Mli1t3r3gU='
WHERE
key_id = 'f42b723623b76fad952ebbc4a01655a1e817c3247d70a22c05135b144245b645'
AND (
token = 'Pb84OacbXPbScO3Xm80BvlXmq36o/JqH7Mli1t3r3gU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)