UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'FJp8S9nZ2yPc7v5YRP6oxLz/MUov00Mnsa1Cg1XCjv0=' 
WHERE 
  key_id = '51dcfa06c73f031396c6b7a01b4bf049ae3bd5fc12b3d05395bb874d640d19a3' 
  AND (
    token = 'FJp8S9nZ2yPc7v5YRP6oxLz/MUov00Mnsa1Cg1XCjv0=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00041