UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'rv4Xz9DMmV9xCCH72IIPdYLrsZqfxvqRNKc4UkoDXys=' 
WHERE 
  key_id = 'b66961755a410d24c1c18a4a6b68fea7dfcac56222ffd43b94a59b804e17e73a' 
  AND (
    token = 'rv4Xz9DMmV9xCCH72IIPdYLrsZqfxvqRNKc4UkoDXys=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00040