UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'GquHWIEq/RJgUSiIGZkqv0RCvOBpWY5xsoySv/kQcIg=' 
WHERE 
  key_id = 'c7baf96fef483405aee12ac90091e467cf22da6a3c0a22792391989bdff27523' 
  AND (
    token = 'GquHWIEq/RJgUSiIGZkqv0RCvOBpWY5xsoySv/kQcIg=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00036