UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'p0Nf7lLB9pVf+BvCk7KDjlfUubcELtbFPIR/6X3oq7g='
WHERE
key_id = 'faeff07580f913d01b8c8396299250cddf296eb4ac2aefe8aeabf928d4d2ab4a'
AND (
token = 'p0Nf7lLB9pVf+BvCk7KDjlfUubcELtbFPIR/6X3oq7g='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)