UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'IRcpWSCvyTgSzRjwVM505ScO4cnYxwUeY2LTg4JAaQs=' 
WHERE 
  key_id = '69f7b4fec59a0ae984433733162353b1c833ae13edb41243c6057bde06b890a7' 
  AND (
    token = 'IRcpWSCvyTgSzRjwVM505ScO4cnYxwUeY2LTg4JAaQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00047