UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'a3mRG9fiq8KSEZ6hTVPoca6ccthgmF+DVMjHY5IT9Hk=' 
WHERE 
  key_id = '06c795318028a3dabda9ceee81434382ddb5a546cc15bd202880aea7f091efa6' 
  AND (
    token = 'a3mRG9fiq8KSEZ6hTVPoca6ccthgmF+DVMjHY5IT9Hk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00037