UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'yOF0RDtWxVUzNXTuMQztiBSQDLp6F1kRD/EWPbkEBhM='
WHERE
key_id = 'bea1de74e00f0b56abcb8191ce961e30d7e25241268815f095e765b330f763e2'
AND (
token = 'yOF0RDtWxVUzNXTuMQztiBSQDLp6F1kRD/EWPbkEBhM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)