UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Twp5vhveVGlO7oA1h2gMQ03tRXh8t7vsrY9tcS0ubIM='
WHERE
key_id = 'aa39064dc7fb8b10f646a4889d2fa96267569b703da39c85ab90a78d7d9425cf'
AND (
token = 'Twp5vhveVGlO7oA1h2gMQ03tRXh8t7vsrY9tcS0ubIM='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)