UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '56+THczlLn0bgXept5OwRBGXJhdImYybJnKaPN738eY=' 
WHERE 
  key_id = 'b300fc54da3d21a07fe815c775840337bfba7d1849985763c757a899a801d496' 
  AND (
    token = '56+THczlLn0bgXept5OwRBGXJhdImYybJnKaPN738eY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00030