UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'PQOx2Yzd/cejcgp3y2q45MUg9vf331AX2V5quIDqZAk='
WHERE
key_id = '61defea1bb035c79741471635a3c32f60100a78c6d0e511f19cacd5a1b0250ec'
AND (
token = 'PQOx2Yzd/cejcgp3y2q45MUg9vf331AX2V5quIDqZAk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)