UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'WQlI1W1VIaeBTG9fKue60z1X3FmMOxg/LVprhuaP6BQ=' 
WHERE 
  key_id = '2deca02d60c93760e0d596a12988286e820d487c3f9258d931d7ebe18c0abfac' 
  AND (
    token = 'WQlI1W1VIaeBTG9fKue60z1X3FmMOxg/LVprhuaP6BQ=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00091