UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'NeG41NwRyUKxJr4dhAcAOjxlgeWkId6nMdIekd4rhCw=' 
WHERE 
  key_id = '320e97c5f3f12a22fd40a8af35d2caea557e4bdd0da94671c382c7d8b45443f5' 
  AND (
    token = 'NeG41NwRyUKxJr4dhAcAOjxlgeWkId6nMdIekd4rhCw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026