UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '80i3MtLEenKV7Q1Il4sB9YmLllri1PvPFHmxO+/0+nw=' 
WHERE 
  key_id = '63070b8423750c8144863b6b6e555037fe561b7a9d1aa0e1980ee710ba65e320' 
  AND (
    token = '80i3MtLEenKV7Q1Il4sB9YmLllri1PvPFHmxO+/0+nw=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00035