UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'iATn/4bYLDbx9e8aGiK4bf1eMOWGJI100y8fClWRjts=' 
WHERE 
  key_id = '9a828bdf9e1b20feac25be4a7d6305acde51ce9fc58bcbb63c202f3a402f36db' 
  AND (
    token = 'iATn/4bYLDbx9e8aGiK4bf1eMOWGJI100y8fClWRjts=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00014