UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'NkoyvdWLc+8GXxZe8Osq/nagVPXz8FaX7iQsrxTzh60='
WHERE
key_id = '99220c8c071d2d23d806a376a52c22d8fe710602fc3f9211c4f45aedc014d5db'
AND (
token = 'NkoyvdWLc+8GXxZe8Osq/nagVPXz8FaX7iQsrxTzh60='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)